<?php
/**
 * StaticFile.php
 * 
 * @category   Naneau
 * @package    Naneau_View_Helper
 * @copyright  Copyright (c) 2007 Maurice Fonk - http://naneau.nl
 * @version    0.1.1
 */

/**
 * Naneau_View_Helper_StaticFile
 * 
 * a view helper for static files
 *
 * @category   Naneau
 * @package    Naneau_View_Helper
 * @copyright  Copyright (c) 2007 Maurice Fonk - http://naneau.nl
 */
class Naneau_View_Helper_StaticFile {
    
    /**
     * get a link to a static file with the current baseUrl
     *
     * @param string $file
     * @return string
     */
    public function staticFile($file) {
        $file = trim($file);
        //trim the file name (just in case)
        $frontController = Zend_Controller_Front::getInstance();
        //front controller
        $baseUrl = $frontController->getBaseUrl();
        //base url for this application
        return $baseUrl . '/' . $file;
        //the link to the file, relative to the base url
    }
}